<!--
 * @Description: 轮播图
 * @Author: xiao li
 * @Date: 2021-07-04 00:16:14
 * @LastEditTime: 2023-02-16 14:48:45
 * @LastEditors: xiao li
-->
<template>
  <div
    :style="{
      paddingTop: o.data.style.whiteSpace / 2 + 'px',
      paddingBottom: o.data.style.whiteSpace / 2 + 'px',
      paddingLeft: o.data.style.wingBlank / 2 + 'px',
      paddingRight: o.data.style.wingBlank / 2 + 'px'
    }"
  >
    <el-carousel
      :height="
        o.data.style.number
          ? o.data.style.number / 2 + 'px'
          : o.data.style.height / 2 + 'px'
      "
      indicator-position="none"
    >
      <el-carousel-item v-for="(item, index) in o.data.bannerList" :key="index">
        <img
          style="width: 100%; height: 100%"
          :src="item.img[0] && item.img[0].url"
        />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
<script>
export default {
  name: 'banner',
  props: {
    o: Object
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
img {
  object-fit: cover;
}
</style>
